package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 获取最近浏览的表格数据的controller层
 * @author Administrator
 *
 */

import com.zr.service.DgLookService;
import com.zr.service.impl.DgLookServiceImpl;

import net.sf.json.JSONObject;
public class DgLookController extends HttpServlet{

	DgLookService ds = new DgLookServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		
		JSONObject jObject = ds.getDgLook();
		PrintWriter pWriter = resp.getWriter();
		pWriter.write(jObject.toString());
		
		pWriter.flush();
		pWriter.close();
		
	}
	
}
